package com.hwpt.hwaccount.feature.security;

import com.hwpt.hwaccount.core.base.BaseContract;
import com.hwpt.hwaccount.core.data.local.entity.UserEntity;

public interface SecurityContract {

    interface View extends BaseContract.View {
        void showSecurityInfo(UserEntity user);
    }

    interface Presenter extends BaseContract.Presenter<View> {
        void loadSecurityInfo();
        void changePassword(String currentPassword, String newPassword);
        void setupEmergencyContact(String name, String phone, String relationship);
        void sendPhoneVerifyCode(String phone);
        void bindPhone(String phone, String code);
        void unbindPhone();
        void sendEmailVerifyCode(String email);
        void bindEmail(String email, String code);
    }

    interface Model extends BaseContract.Model {
        void getUserInfo(DataCallback<UserEntity> callback);
        void updateUserInfo(UserEntity user, DataCallback<Boolean> callback);
        void changePassword(String currentPassword, String newPassword, DataCallback<Boolean> callback);
        void setupEmergencyContact(String name, String phone, String relationship, DataCallback<Boolean> callback);
        void sendPhoneVerifyCode(String phone, DataCallback<Boolean> callback);
        void bindPhone(String phone, String code, DataCallback<Boolean> callback);
        void unbindPhone(DataCallback<Boolean> callback);
        void sendEmailVerifyCode(String email, DataCallback<Boolean> callback);
        void bindEmail(String email, String code, DataCallback<Boolean> callback);

        interface DataCallback<T> {
            void onSuccess(T data);
            void onError(String message);
        }
    }
}